<?php

class MasterDataTableSeeder extends Seeder
{

	public function run()
	{
        /*
            Users Table Seeder
        */
		DB::table('users')->delete();
		User::create(array('name' => 'Fahmi Zulhasymi', 'username' => 'fahmi', 'email' => 'fahmi@coderkontrakan.com', 'password' => Hash::make('awesome'), 'group_id' => 'admin', 'is_enabled' => 1,));
        User::create(array('name' => 'Tiffany Afif','username' => 'tiffany', 'email' => 'tiffany@coderkontrakan.com', 'password' => Hash::make('awesome'), 'group_id' => 'leader', 'is_enabled' => 1,));
        User::create(array( 'name' => 'Asep Patahudin', 'username' => 'asep', 'email' => 'asep@coderkontrakan.com', 'password' => Hash::make('awesome'), 'group_id' => 'employee', 'is_enabled' => 1,));
        /*
            Users Table Group
        */
        DB::table('group')->delete();
		Group::create(array('id' => 'admin', 'name' => 'Administrator', 'description' => 'Administrator Master Data', 'is_enabled' => 1,));
		Group::create(array('id' => 'leader', 'name' => 'Leader', 'description' => 'Leader Project', 'is_enabled' => 1,));
		Group::create(array('id' => 'employee', 'name' => 'Employee', 'description' => 'Employee', 'is_enabled' => 1,));
        /*
            Users Table Module
        */
        DB::table('module')->delete();
		Module::create(array('id' => 'master_data','name' => 'Master Data', 'icon' => 'archive', 'sequence' => 1, 'is_enabled' => 1,'is_show' => 1,));
		Module::create(array('id' => 'privilege_management','name' => 'Privilege Management', 'icon' => 'cogs', 'sequence' => 2, 'is_enabled' => 1,'is_show' => 1,));
		Module::create(array('id' => 'task','name' => 'Task', 'icon' => 'task','sequence' => 3, 'is_enabled' => 1,'is_show' => 1, ));
		Module::create(array('id' => 'issue','name' => 'Issue', 'icon' => 'comments',  'sequence' => 4, 'is_enabled' => 1,'is_show' => 1, ));
	    /*
            Users Table Functions
        */
        DB::table('functions')->delete();
		Functions::create(array('id' => 'comment', 'module_id'=>'master_data', 'name' => 'Comment',  'url' => 'comment', 'sequence' => 1, 'icon' => 'comment', 'is_enabled' => 1, 'is_show' => 1,));
		Functions::create(array('id' => 'project', 'module_id'=>'master_data', 'name' => 'Project',  'url' => 'project', 'sequence' => 2, 'icon' => 'briefcase', 'is_enabled' => 1, 'is_show' => 1,));
		Functions::create(array('id' => 'tag', 'module_id'=>'master_data','name' => 'Tag','url' => 'tag','sequence' => 3,'icon' => 'tags', 'is_enabled' => 1, 'is_show' => 1,));
		Functions::create(array('id' => 'priority', 'module_id'=>'master_data', 'name' => 'Priority', 'url' => 'priority','sequence' => 4,'icon' => 'star','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'status', 'module_id'=>'master_data','name' => 'Status','url' => 'status','sequence' => 5,'icon' => 'certificate','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'group', 'module_id'=>'master_data','name' => 'Group','url' => 'group','sequence' => 6,'icon' => 'users','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'log', 'module_id'=>'master_data','name' => 'Log','url' => 'log','sequence' => 7,'icon' => 'book','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'user', 'module_id'=>'master_data', 'name' => 'User','url' => 'user','sequence' => 1,'icon' => 'user','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'module', 'module_id'=>'privilege_management', 'name' => 'Module','url' => 'module','sequence' => 2,'icon' => 'sliders','is_enabled' => 1,'is_show' => 1,));
		Functions::create(array('id' => 'functions', 'module_id'=>'privilege_management', 'name' => 'Functions','url' => 'functions','sequence' => 3,'icon' => 'puzzle-piece','is_enabled' => 1,'is_show' => 1,));
        Functions::create(array('id' => 'privilege_info', 'module_id'=>'privilege_management', 'name' => 'Privilege Info','url' => 'privilegeinfo','sequence' => 4,'icon' => 'sign-out','is_enabled' => 1,'is_show' => 1,));
		/*
            Users Table PrivilegeInfo
        */
        DB::table('privilegeinfo')->delete();
		
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'project', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'tag', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'priority', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'status', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'log', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'group', 'is_allow_access' => 1,));
        PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'master_data', 'functions_id' => 'user', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'privilege_management', 'functions_id' => 'module', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'privilege_management', 'functions_id' => 'functions', 'is_allow_access' => 1,));
		PrivilegeInfo::create(array('group_id' => 'admin', 'module_id' => 'privilege_management', 'functions_id' => 'privilege_info', 'is_allow_access' => 1,));
        /*
            Users Table Project
        */
        DB::table('project')->delete();
		Project::create(array('name' => 'Task Tracker', 'description' => 'This Great System', 'start_date' => '2014-09-09 00:00:00', 'due_date' => '2014-10-10 00:00:00', 'users_username' => 'tiffany',));
		Project::create(array('name' => 'Geany', 'description' => 'Awesome Custom Framework', 'start_date' => '2014-09-09 00:00:00', 'due_date' => '2014-10-10 00:00:00', 'users_username' => 'tiffany',));
        /*
            Users Table Priority
        */
        DB::table('priority')->delete();
		Priority::create(array('name' => 'urgent', 'level' => '5', 'description' => 'Urgensi',));
		Priority::create(array('name' => 'normal', 'level' => '3', 'description' => 'Standart priority',));
		Priority::create(array('name' => 'nice to have', 'level' => '1', 'description' => 'Fitur tambahan jika ada waktu',));
		
        /*
            Users Table Status
        */
        DB::table('status')->delete();
		Status::create(array('id' => 'open', 'name' => 'Open', 'description' => 'Document baru dibuat' ,));
		Status::create(array('id' => 'in_progress', 'name' => 'In Progress', 'description' => 'Document sedang dikerjakan programmer' ,));
		Status::create(array('id' => 'ready_for_qc', 'name' => 'Ready for QC', 'description' => 'Document siap di test' ,));
        Status::create(array('id' => 'done', 'name' => 'Done', 'description' => 'Document siap' ,));
        Status::create(array('id' => 'Cancel', 'name' => 'Cancel', 'description' => 'Document di cancel' ,));
        /*
            Users Table Log
        */
        DB::table('log')->delete();
		
    }
	    
	

}
?>